import { defineStore } from 'pinia';
import { Event,EventSy,EventItem } from './interface';
import {homeApi} from "/@/api/home/index"
const homeCalendar = homeApi();


/**
 * getEventList 获取所有列表事项
 */
export const getEventList = defineStore('home', {
	state: (): Event => ({
		eventData:[],
	}),
	actions: {
		async getEventListLoader() {
           const res = await homeCalendar.getMatterCodes({});

           const resData:[] = res.data.map((item:EventItem,index:number)=>{
              let  dt:EventSy = {
                LABELVALUE:item.label,
                TITLEVALUE:item.value,
               }
               return dt
            })
           this.eventData = resData;
		},
        // async getEventData(params:object){
           
        // }

	},
});
